#pragma once

#include "VertexType.h"

class Material;
class BoneInfo;

enum MeshType
{
	STATIC_MESH,
	SKINNED_MESH,
	SHADER_SKINNED_MESH
};

struct RenderGroup
{
	std::string m_name;
	std::string m_materialName;
	unsigned int m_startIndex;
	unsigned int m_indexCount;
};

class MeshBase
{
public:
	MeshBase(void);
	virtual ~MeshBase(void);

public:
	virtual BOOL LoadFromXml( const char* fileName )	{ return TRUE; }

public:
	virtual void Update( float dTime )	{}
	virtual void Render() = 0;
	virtual void DrawNormal();

protected:
	BOOL CreateVB();
	BOOL CreateIB();

protected:
	std::string m_name;
	MeshType	m_meshType;

	VertexType	m_vertexType;
	UINT	m_uVertexCount;
	float *	m_pVertices;

	UINT	m_uIndexCount;
	DWORD *	m_pIndices;

	LPDIRECT3DVERTEXBUFFER9	m_pVB;
	LPDIRECT3DINDEXBUFFER9 m_pIB;

	std::vector<RenderGroup> m_renderGroupList;

	std::map<std::string, Material *> m_materialMap;

	BoneInfo * m_transformNodeStructure;
};
